﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using DataAccessClasses;

namespace mobliebo
{
    public class Adminlogin1
    {

        iDAC DAC = DACFactory.GetDAC();
        private long _id = -99;
        private string _emailid = "";
        private string _password = "";
        public  long id
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
            }
        }
        public string emailid
        {
            get
            {
                return _emailid;
            }
            set
            {
                _emailid = value;
            }
        }
        public string password
        {
            get
            {
                return _password;
            }
            set
            {
                _password = value;
            }
        }



        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@id", id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@emailid", emailid, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@password", password, DbType.AnsiString, ParameterDirection.Input);

                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1,dbparam2 };
                return DAC.Save("Adminlogin_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords( long id, string emailid, string password, string andor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@id", id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@emailid" ,emailid, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@password", password, DbType.AnsiString, ParameterDirection.Input);

                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1,dbparam2 };
                // return DAC.Save("Admin_get",dbparamcall);
                DataTable dt1 = DAC.Select("Adminlogin_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;
        }
    }
}




